package com.winshare.saleAssistant.domain.dto.req;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

@ApiModel
public class StaffExcelExportDTO {

    @ApiModelProperty(value = "机构编码")
    private String orgCode;

    @ApiModelProperty(value = "机构名称")
    private String orgName;

    @ApiModelProperty(value = "激活状态：1,已激活；0,未激活")
    private Integer isActive;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "姓名")
    private String staffName;

    @NotNull(message = "每页数量不能为空")
    @Range(min = 1, max = 1000,message = "最多导出1000条数据")
    @ApiModelProperty(value = "每页数量，建议10-20")
    private Integer pageSize;

    @NotNull(message = "第几页 字段为能为空")
    @Range(min = 1, message = "页号至少从第1页开始")
    @ApiModelProperty(value = "第几页，从1开始")
    private Integer pageIndex;

    @NotNull(message = "机构类型不能为空")
    @Range(min = 1,max = 5,message = "机构类型key: 1.业务组织单位; 2.市公司;3.分公司;4,其它; 5.全部")
    @ApiModelProperty(notes = "机构类型key: 1.业务组织单位; 2.市公司;3.分公司;4,其它; 5.全部")
    private Integer orgTypeKey;

    @ApiModelProperty(value = "阅读次数")
    private Integer readCount;

    @ApiModelProperty(value = "分享次数")
    private Integer promotionCount;

    @ApiModelProperty(value = "登錄次數")
    private Integer loginCount;

    @ApiModelProperty(value = "是否切換模式")
    private Integer isChangeModel;

    @ApiModelProperty(value = "激活時間")
    private String activeTime;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    public Integer getOffsetIndex() {
        return pageSize * (pageIndex < 1 ? 0 : pageIndex-1);
    }

    public StaffExcelExportDTO() {
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public Integer getIsActive() {
        return isActive;
    }

    public void setIsActive(Integer isActive) {
        this.isActive = isActive;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getOrgTypeKey() {
        return orgTypeKey;
    }

    public void setOrgTypeKey(Integer orgTypeKey) {
        this.orgTypeKey = orgTypeKey;
    }

    public Integer getReadCount() {
        return readCount;
    }

    public void setReadCount(Integer readCount) {
        this.readCount = readCount;
    }

    public Integer getPromotionCount() {
        return promotionCount;
    }

    public void setPromotionCount(Integer promotionCount) {
        this.promotionCount = promotionCount;
    }

    public Integer getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(Integer loginCount) {
        this.loginCount = loginCount;
    }

    public Integer getIsChangeModel() {
        return isChangeModel;
    }

    public void setIsChangeModel(Integer isChangeModel) {
        this.isChangeModel = isChangeModel;
    }

    public String getActiveTime() {
        return activeTime;
    }

    public void setActiveTime(String activeTime) {
        this.activeTime = activeTime;
    }

//    public Integer getRoleType() {
//        return roleType;
//    }
//
//    public void setRoleType(Integer roleType) {
//        this.roleType = roleType;
//    }
}
